export const pageSizeOptions = [
  '10',
  '20',
  '30',
  '50',
  '100',
];
export const showTotal = (all, range) => `${range[0]} - ${range[1]} 共 ${all} 条数据`;
export const defaultPageSize = 30;

export const createPagination = (searchResult, handlePageChange) => ({
  current: searchResult.getIn(['data', 'filter', 'current']) || 1,
  pageSize: searchResult.getIn(['data', 'filter', 'pageSize']) || 30,
  total: parseInt(searchResult.getIn(['data', 'filter', 'total']), 10) || 0,
  showSizeChanger: true,
  showQuickJumper: true,
  showTotal: (total, range) => `${range[0]} - ${range[1]} 共 ${total} 条数据`,
  onChange: handlePageChange,
  onShowSizeChange: handlePageChange,
  pageSizeOptions,
});
